package com.day13.ex02;

import java.text.ParseException;
import java.util.Date;

public class DateDemo2 {
    public static void main(String[] args) throws ParseException {
        Date d=new Date();
        String s1=DateUtils.dateToString(d,"yyyy-MM-dd HH:mm:ss");
        System.out.println(s1);
        String s2=DateUtils.dateToString(d,"yyyy年MM月dd日 HH时mm分ss秒");
        System.out.println(s2);
        String s3=DateUtils.dateToString(d,"yyyy-MM-dd");
        System.out.println(s3);
        String s="2020-01-01 12:12:12";
        Date dd=DateUtils.stringToDate(s,"yyyy-MM-dd HH:mm:ss");
        System.out.println(dd);
    }
}
